﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace QuanLyThuNgan
{
    public class DMPhanLoaiPTBHYTDAO
    {
        public bool m_Insert(DMPhanLoaiPTBHYTDTO _info)
        {
            int plpt = 0;
            if (_info.BbNgungSuDung == true)
                plpt = 1;
            string _sql = string.Format("usp_ThuNgan_DMPhanLoaiPTBHYT_Insert  N'{0}',N'{1}',{2}", _info.STenPhanLoaiPTBHYT, _info.STenVni, plpt);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Update(DMPhanLoaiPTBHYTDTO _info)
        {
            int plpt = 0;
            if (_info.BbNgungSuDung == true)
                plpt = 1;
            string _sql = string.Format("usp_ThuNgan_DMPhanLoaiPTBHYT_Update {0},N'{1}',N'{2}',{3}", _info.IIDPhanLoaiPTBHYT, _info.STenPhanLoaiPTBHYT, _info.STenVni, plpt);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
        public bool m_Delete(DMPhanLoaiPTBHYTDTO _info)
        {
            string _sql = string.Format("usp_ThuNgan_DMPhanLoaiPTBHYT_Delete {0}", _info.IIDPhanLoaiPTBHYT);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }

        public DataTable m_SelectAllDMPhanLoaiBHYT()
        {
            string _sql = string.Format("usp_ThuNgan_DMPhanLoaiPTBHYT_SelectAll");
            return Uit.it_SQL.getDataTable(_sql, null, "");
        }
    }
}
